<?php

declare(strict_types=1);

namespace App\Api\Controller;

use App\Api\Middleware\ResponseMiddleware;
use App\Api\Service\CarCategoryService;
use Hyperf\Contract\LengthAwarePaginatorInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\HttpServer\Annotation\Middlewares;

#[Controller(prefix: 'api'), Middlewares([ResponseMiddleware::class])]
class CarCategoryController
{
    /**
     * 车辆分类列表
     * @param CarCategoryService $service
     * @return LengthAwarePaginatorInterface
     */
    #[GetMapping('car_categories')]
    public function index(CarCategoryService $service)
    {
        return $service->index();
    }
}
